/**
 * Project: ServletDemo
 * File Created at 2012-8-21下午10:43:46
 */
package demo.other.thread;

/**
 * 通过实现Runnable接口创建一个线程
 * @author Administrator
 * 2012-8-21下午10:43:46
 */
public class RunnableTest implements Runnable{

    /**
     * 实现run()方法 JVM会自动调用该方法
     */
    public void run() {
        for(int i =0;i<4;i++){
            System.out.println("I'm running !"+i);
        }
    }
    
    public static void main(String[] args) throws InterruptedException {
        RunnableTest r = new RunnableTest();
        Thread t = new Thread(r);
        t.start();
        for(int i =0;i<5;i++){
            System.out.println("I'm running out!"+i);
        }
    }

}
